<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script  type="text/javascript" th:src="@{/jquery/1.9.1/jquery.js}"></script>


    <!--        $(function(){-->
    <
    <!--    }-->
    <script  type="text/javascript"  th:inline="javaScript">
          var studentList = [[${list}]];

          $(document).ready(function(){
                console.log("aaa");
                // alert("aaa")
                 $("button").click(function(){
                    alert("aaa");

                });

                var user= {

                "page" : 1,

                "rows" : 10,

                // "studentName":"张"

                };

                $.ajax({

                    url : "http://localhost:8083/student/getStudentList",

                    type : "POST",

                    async : true,

                    data : user,

                    dataType : 'json',

                     success : function(data) {

                        console.log("data" , data);
                         console.log(typeof (data));
                         console.log(data.datas);
                        studentList = data.datas;

                        let url = "http://localhost:8083/student/getStudent"
                        ${".table"}.load();
                    }

                });
          })

    </script>
</head>
<body>
    学生啊
<!--    <button id="button" onclick="">112233</button>-->
    <button>999</button>
    <table th:fragment="table" border="1" th:width="100" th:height="100">	<tr th:each="m:${list}">
        <!-- 其中m是个临时变量，像for(User u : userList)那样中的u-->
        <td th:width="30" th:height="30" th:text="${m.name}"/>
        <td th:text="${m.age}"/>
    </tr></table>

    <form action="#" th:action="@{/student/getStudentList}"  method="post">
        <p>page: <input type="number" th:name="page" /></p>
        <p>rows: <input type="number" th:name="rows"  /></p>
        <p>studentName: <input type="text" th:name="studentName" /></p>
        <p><input type="submit" value="Submit" /> <input type="reset" value="Reset" /></p>
    </form>

    <form action="#" th:action="@{/student/addStudent}" th:object="${student}" enctype="multipart/form-data" method="post">
        <p>file: <input type="file" th:name="file" /></p>
        <p>sn:<input type="number" th:field="*{sn}" /></p>
        <p>username:<input type="text" th:field="*{username}" /></p>
        <p>password:<input type="text" th:field="*{password}" /></p>
        <p>clazzId:<input type="text" th:field="*{clazzId}" /></p>
        <p>sex:<input type="text" th:field="*{sex}" /></p>
        <p>mobile:<input type="text" th:field="*{mobile}" /></p>
        <p>qq:<input type="text" th:field="*{qq}" /></p>
        <p><input type="submit" value="Submit"/> <input type="reset" value="Reset" />  </p>
    </form>
</body>
</html>